/*
 * ota.h
 *
 *  Created on: Nov 17, 2023
 *      Author: lye21
 */

#ifndef INC_OTA_H_
#define INC_OTA_H_

#include "stmflash.h"
#include "w25qxx.h"
#include "main.h"

#define EEPROM_BASE_ADDR     	0x08080000     			//EEPROM地址
#define EEPROM_OTA_ADDR			800						//OTA升级状态地址
#define Application_Addr		0x08080800				// 应用程序1的首地址

#define PEKEY1	0x89ABCDEF					//FLASH_PEKEYR
#define PEKEY2	0x02030405					//FLASH_PEKEYR
#define EN_INT __enable_irq();     			//系统开启全部中断
#define DIS_INT __disable_irq();    		//系统关闭全局中断

void EEPROM_WriteBytes(uint16_t Addr, uint8_t *Buffer, uint16_t Length);
int EEPROM_ReadBytes(uint16_t Addr);

#endif /* INC_OTA_H_ */
